package com.easylinkin.linkappapi.webcammanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.device.entity.Device;
import com.easylinkin.linkappapi.webcammanage.entity.DeviceAttributeStatus;
import com.easylinkin.linkappapi.webcammanage.entity.BindDeviceParams;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * class info :
 *
 * @author 刘启航
 * @date 2021/4/20 10:54
 */
public interface DeviceAreaHandlerMapper extends BaseMapper<Device> {

    /**
     * 获取未绑定区域的设备列表
     *
     * @param page
     * @param device
     * @return
     */
    List<Device> selectUnBindDevices(Page page, @Param("device") Device device);


    List<DeviceAttributeStatus> getDeviceVideoList(Page page, @Param("device") Device device);

    /**
     * 批量解绑--区域和设备关联
     *
     * @param idList 设备Id list
     */
    void unBindDevice(@Param("idList") List<String> idList);

    /**
     * 批量绑定--区域和设备关联
     *
     * @param deviceList 赋值设备ID  / 区域ID area_id和area_path
     */
    void bindDevice(@Param("deviceList") List<BindDeviceParams> deviceList);

    //获取含摄像头videoMedia类型的设备列表
    List<DeviceAttributeStatus> getVideoTypeDeviceListGlobal(Page page, @Param("device") Device device);

    Integer getDeviceVideoCount(@Param("device") Device device);


    List<DeviceAttributeStatus> getVideoInfoByDeviceGlobal(@Param("deviceId") String deviceId, @Param("deviceIds") Collection<String> deviceIds);

}
